home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Freeware / Pixload / Pixload-Prefs < prev    next >
Encoding:
Text File  |  2002-03-13  |  5.1 KB  |  234 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6.  
  7. call init
  8. call CreateApp
  9. call Lecture
  10. call HandleApp
  11.  
  12. /************************************************/
  13. init: procedure expose nb nbicon
  14.  
  15.    l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  16.    if AddLibrary("rxmui.library")~=0 then exit
  17.    call RxMUIOpt("debugmode showerr")
  18.  
  19.    call open(chemin,"Pixload:Prefs/Pixload.prefs",'Read')
  20.         nbicon=readln(chemin)
  21.         nb=nbicon
  22.    close(chemin)
  23.  
  24.    return
  25.  
  26. /***********************************************************************/
  27. HandleApp: procedure expose nb nbicon
  28.  
  29.  
  30.     ctrl_c=2**12
  31.     do forever
  32.  
  33.         call NewHandle("app","h",ctrl_c)
  34.         if and(h.signals,ctrl_c)>0 then exit
  35.  
  36.         select
  37.            when h.event="QUIT" then exit
  38.            otherwise interpret h.event
  39.         end
  40.     end
  41.  
  42.     /* never reached */
  43. /***********************************************************************/
  44. CreateApp: procedure expose nb nbicon
  45.  
  46.     app.Title="Pixload-Prefs"
  47.     app.Version="$VER: Pixload Prefs 1.63 (24.02.2002)"
  48.     app.Author="Pixel Art - www.pixel-art.fr.st"
  49.     app.Base="Pixload-config"
  50.     app.SubWindow="win"
  51.  
  52.      win.ID="MAIN"
  53.      win.Title="Pixload's settings"
  54.  
  55.      win.Contents="mgroup"
  56.  
  57.     mgroup.0="tex"
  58.        tex.class="group"
  59.        tex.frame="group"
  60.        tex.columns=7
  61.  
  62.        tex.0=checkMark("barre",0)
  63.  
  64.        tex.1="texx"
  65.           texx.class="text"
  66.           texx.contents=Parsetext("%0Dragbar")
  67.  
  68.        tex.2=checkmark("large",0)
  69.  
  70.        tex.3="texx0"
  71.           texx0.class="text"
  72.           texx0.contents=Parsetext("%0Horizontal")
  73.  
  74.        tex.4="texx1"
  75.          texx1.class="numericbutton"
  76.          texx1.min=1
  77.          texx1.max=13
  78.          texx1.value=nbicon
  79.  
  80.        tex.5="texx2"
  81.          texx2.class="text"
  82.          texx2.contents=Parsetext("%0Icons")
  83.  
  84.        tex.6="texx3"
  85.          texx3.class="text"
  86.          texx3.contents=""
  87.          texx3.inputmode="relverify"
  88.          texx3.frame="button"
  89.  
  90.     mgroup.1="ctrlg"
  91.        ctrlg.class="group"
  92.        ctrlg.frame="group"
  93.        ctrlg.columns=4
  94.  
  95.      do i=0 to nbicon-1
  96.  
  97.          k=i*4
  98.          ctrlg.k="bm1."i
  99.          bm1.i.class="gfxpic"
  100.          bm1.i.ShortHelp=Parsetext("%cCliquer sur le petit bouton si c'est un script\nClick on this little button if is a script")
  101.          bm1.i.source="Pixload:icones/"i
  102.          bm1.i.transparent=1
  103.          bm1.I.scale=70
  104.          bm1.i.precision="image"
  105.          bm1.i.draw=1
  106.  
  107.          k=i*4+1
  108.          ctrlg.k="bm."i
  109.          bm.i=CheckMark("bm."i,0)
  110.        
  111.          k=i*4+2
  112.          ctrlg.k="popf."i
  113.          popf.i.class="popasl"
  114.          popf.i.ShortHelp='Programs'
  115.          popf.i.string=string("file."i,"f")
  116.  
  117.          k=i*4+3
  118.          ctrlg.k="gg."i
  119.          gg.i.class="group"
  120.          gg.i.ShortHelp=Parsetext("Help")
  121.           sa.i.CycleChain=1
  122.           gg.i.0=String("sa."i,"f")
  123.  
  124.     end
  125.  
  126.     if NewObj("APPLICATION","APP")>0 then exit
  127.  
  128.     call Notify("win","CloseRequest",1,"APP","ReturnID","quit")
  129.  
  130.     call Notify("barre","selected","everytime","app","Return","call Stocke(nb)")
  131.   
  132.     call Notify("texx3","selected",0,"app","Return","call Stocke(nb)")
  133.  
  134.     call Notify("texx1","value","everytime","app","return","call stocke(h.value)","triggerattr")
  135.  
  136.     call Notify("large","selected","everytime","app","Return","call Stocke(nb)")
  137.  
  138.     call set("win","open",1)
  139.  
  140. return
  141.  
  142. /***************************************/
  143. Lecture: procedure
  144.  
  145.     call open(chemin,"Pixload:Prefs/Pixload.prefs",'Read')
  146.  
  147.     nbicon=readln(chemin)
  148.     fichier.num=readln(chemin)
  149.     call set(barre,"selected",fichier.num)
  150.  
  151.     fichier.num=readln(chemin)
  152.     call set(large,"selected",fichier.num)
  153.  
  154.     do num=0 while ~EOF(chemin)
  155.  
  156.        fichier.num=readln(chemin)
  157.  
  158.        if fichier.num~="" then do
  159.  
  160.           if fichier.num==1 then call set(bm.num,"selected",fichier.num)
  161.  
  162.              fichier.num=readln(chemin)
  163.              call set(file.num,"contents",fichier.num)
  164.  
  165.              fichier.num=readln(chemin)
  166.              call set(sa.num,"contents",fichier.num)
  167.        end
  168.  
  169.     end
  170.  
  171.     call close(chemin)
  172.     call set("app","sleep",0)
  173.  
  174. return
  175.  
  176.  
  177. /*--------------------------------*/
  178. Stocke: procedure expose nb nbicon
  179.  
  180. Parse arg nbb
  181.  
  182. call open(adresse,"Pixload:Prefs/Pixload.prefs",'Write')
  183.  
  184.      call WriteLN(adresse,nbb)
  185.      call WriteLN(adresse,xget("barre","selected"))
  186.      call WriteLN(adresse,xget("large","selected"))
  187.  
  188.      nbb=nbb-1
  189.  
  190.     do i=0 to nbb
  191.  
  192.        if nbb<nbicon then do
  193.  
  194.        call WriteLN(adresse,xget("bm."i,"selected"))
  195.        call WriteLN(adresse,xget("file."i,"contents"))
  196.        call WriteLN(adresse,xget("sa."i,"contents"))
  197.  
  198.        end
  199.  
  200.        else do
  201.  
  202.        call WriteLN(adresse,"")
  203.        call WriteLN(adresse,"")
  204.        call WriteLN(adresse,"")
  205.  
  206.        end
  207.  
  208.     end
  209.  
  210.     call set("texx3","contents",Parsetext("%c%0Save / Update"))
  211.  
  212.     nb=nbb+1
  213.  
  214.     call close(adresse)
  215.  
  216.     if show('P','PIXLOAD.1') then
  217.        do
  218.         address 'PIXLOAD.1'
  219.         address command 'copy ram:env/mui/pixload.1.prefs to sys:prefs/env-archive/mui/pixload.1.prefs'
  220.         Quit
  221.        end
  222.  
  223.     address command 'sys:c/wait sec=1'
  224.     address command 'sys:c/wbrun sys:wbstartup/Pixload'
  225.  
  226.  
  227. return
  228.  
  229. /*------------- */
  230. halt:
  231. break=_c:
  232. exit
  233.  
  234.